package my.iterator.composite;
import lombok.Data;
import java.util.Iterator;

//菜单项 实现类
@Data
public class MenuItem extends MenuComponent {
    //菜单项 名称
    private String name;
    //菜单项 描述
    private String description;
    //是否是素食
    private boolean vegetarian;
    //价格
    private double price;
    public MenuItem(String name,String description,boolean vegetarian,double price){
        this.name=name;
        this.description=description;
        this.vegetarian=vegetarian;
        this.price=price;
    }

    @Override
    public void print() {
        System.out.println(getName());
        /*System.out.println(getDescription());
        System.out.println(getPrice());*/
    }

    @Override
    public Iterator createIterator() {
        return new NullIterator();
    }
}
